import reducer from './reducers';
import {createStore,applyMiddleware} from 'redux';
import clientRequest from '../client/request';
import getServerRequest from '../server/request';
import thunk from 'redux-thunk';
import logger from 'redux-logger';
export function getServerStore(req) {
	return createStore(reducer,applyMiddleware(thunk.withExtraArgument(getServerRequest(req)),logger));
}

export function getClientStore() {
	let initState=window.context.state;
	return createStore(reducer,initState,applyMiddleware(thunk.withExtraArgument(clientRequest),logger));
}